# 钟奕升 课堂练习 20240517
liebiao_1 =['pyhsics','钟奕升','math',1997,'2004',1317,'5656','中华人民共和国']
print(type(liebiao_1))
print(type(liebiao_1[0]))
print(type(liebiao_1[3]))
for p in liebiao_1:
    print(p,end=" ")
print()
print(liebiao_1)
print(liebiao_1[1:3])
print("更新前",liebiao_1)
liebiao_1[1]="化学"
print("更新后",liebiao_1)
print("删除前",liebiao_1)
del liebiao_1[4]
print("删除后",liebiao_1)
liebiao_8=[1,2,"我爱我家"]
liebiao_new=liebiao_1+liebiao_8
print("俩个列表相加：",liebiao_new)
print('列表的截取======================')
print(liebiao_new[0:len(liebiao_new)+1:1])
print(liebiao_new[0:len(liebiao_new)+1:2])
print(liebiao_new[3:])
print("a" in liebiao_new)
print("a" not in  liebiao_new)
print("math" in liebiao_new)
print('列表常用函数学习----------------------------------')
liebiao_new .append("math")
print(liebiao_new)
print('math出现次数:',liebiao_new.count('math'))
print('1317出现次数:',liebiao_new.count(1317))
print('index 函数----------------------')
print(liebiao_new.index(1997))
try:
    print(liebiao_new.index('1997'))
except Exception as err:
    print(err)
liebiao_new.remove('math')
print('移除一个math后:',liebiao_new)
del liebiao_new[0]
print('del 第零个元素后',liebiao_new)
print('弹出元素pop---------------')
liebiao_new.pop(0)
print('弹出第零个元素pop',liebiao_new)
print('reverse 列表反序===========')
liebiao_new.reverse()
print('列表反序后',liebiao_new)
liebiao_999=[2,3,4,6,9,786,2,4]
print('排序前',liebiao_999)
liebiao_999.sort()
print('排序后',liebiao_999)

# 钟奕升
print(chr(38047) + chr(22869) + chr(21319))
L = ['a0','a1','a2','a3','a4','a5','a6','a7','a8','a9']
print('L---',L)
print('L[0:-2]---',L[0:-2])
print('L[:-2]---',L[:-2])
print('L[-2:]---',L[-2:])
print('L[-2,6]---',L[-2:6])
print('L[:]---',L[:])
print('L[::-2]---',L[::-2])
print('L[7,-1:-1]---',L[7:-1:-1])
print('L[8:0:-1]---',L[8:0:-1])
print('L[5:1:-2]---',L[5:1:-2])
print('L[4:1:-2]---',L[4:1:-2])


